package com.zhang.controller;

import com.zhang.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhangJunqi
 * @Date 2022/3/17 -20:41
 */
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @ApiOperation ("controller控制方法")
    @PostMapping("getUser")
    public User getUserById(@ApiParam("用户请求ID")Integer id){
        return new User (id,"zs","123");
    }

    @ApiOperation ("post测试方法")
    @PostMapping("userText")
    public User userIn(@ApiParam("用户")User user){
        return user;
    }

}
